const nodemailer = require("nodemailer");
let mailTransport = nodemailer.createTransport({
    host: "smtp.qq.email",
    service: "qq",
    secure: true,
    auth: {
        user: "776875292@qq.com",
        pass: "vyuabfnxjkmibfia",
    },
});
let sendOptions = {
    from: "776875292@qq.com",
    to: "",
    bcc: "密送",
    subject: "vanOrder 验证码",
    text: "van Order邮箱验证码",
    html: "",
};
exports.sendEmailCode = ({ html, to }) => {
    return new Promise((resolve, reject) => {
        mailTransport.sendMail({ ...sendOptions, html: `您的验证码为: <div style='color:cyan;font-size:24px;'>${html}</div>`, to }, err => {
            if (err) {
                reject(err);
            } else {
                resolve();
            }
        });
    });
};
